home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / initTimeSlider.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.2 KB  |  157 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Aug 15 1996
  22. //
  23. //  Description:
  24. //      This script initializes the Time slider.  Initialization involves
  25. //        determining the initial Time slider preferences, creating the UI
  26. //        and setting the initial visibility.
  27. //
  28. {
  29.     // Declare referenced or returned globals.
  30.     //
  31.     global string $gPlayBackSlider;
  32.  
  33.     //  Create the time slider.
  34.     //
  35.     if( `exists timeSlider` ) { 
  36.         eval "source timeSlider";
  37.     }
  38.  
  39.     //////////////////////////////////////////////////////////
  40.     // 
  41.     // ANIMATION CONTROLS
  42.     // 
  43.     //////////////////////////////////////////////////////////
  44.  
  45.     // Height
  46.     //
  47.     timeControl -e -h `optionVar -q timeSliderHeight` $gPlayBackSlider;
  48.  
  49.     // Key Ticks
  50.     //
  51.     string $showKeysVal = `optionVar -q timeSliderShowKeys`;
  52.     if ($showKeysVal != "active" && $showKeysVal != "none") {
  53.         // If optionVar contains name of the channel box, make sure
  54.         // it is using the proper name for the channelbox.
  55.         //
  56.         $showKeysVal = "mainChannelBox";
  57.         optionVar -sv timeSliderShowKeys "mainChannelBox";
  58.     }
  59.  
  60.     timeControl -e -showKeys $showKeysVal $gPlayBackSlider;
  61.  
  62.     // Options: Timecode
  63.     //
  64.     animDisplay -tc `optionVar -q timeSliderTimeCode`;
  65.  
  66.     // Options: Snapping
  67.     //
  68.     timeControl -e -snap `optionVar -q timeSliderSnapping` $gPlayBackSlider;
  69.  
  70.     // Timecode Offset
  71.     //
  72.     animDisplay -timeCodeOffset `optionVar -q timeSliderTimeCodeOffset`;
  73.  
  74.     //////////////////////////////////////////////////////////
  75.     // 
  76.     // PLAYBACK
  77.     // 
  78.     //////////////////////////////////////////////////////////
  79.  
  80.     // Update View
  81.     //
  82.     playbackOptions -v `optionVar -q timeSliderPlayView`;
  83.  
  84.     // Looping
  85.     //
  86.     playbackOptions    -l `optionVar -q timeSliderPlayLoop`;
  87.  
  88.     // Playback Speed
  89.     //
  90.     playbackOptions    -playbackSpeed `optionVar -query timeSliderPlaySpeed`;
  91.  
  92.     // Playback By
  93.     //
  94.     playbackOptions    -by `optionVar -q timeSliderPlayBy`;
  95.  
  96.     //////////////////////////////////////////////////////////
  97.     // 
  98.     // KEYS
  99.     // 
  100.     //////////////////////////////////////////////////////////
  101.  
  102.     // Auto Key
  103.     //
  104.     autoKeyframe -state `optionVar -q autoKeyframeState`;
  105.  
  106.     // Weighted Tangents
  107.     //
  108.     keyTangent -g -weightedTangents `optionVar -q weightedTangents`;
  109.  
  110.     // Default in tangent
  111.     //
  112.     keyTangent -g -inTangentType `optionVar -q inTangentType`;
  113.     
  114.     // Default out tangent
  115.     //
  116.     keyTangent -g -outTangentType `optionVar -q outTangentType`;
  117.     
  118.     //////////////////////////////////////////////////////////
  119.     // 
  120.     // SOUND
  121.     // 
  122.     //////////////////////////////////////////////////////////
  123.  
  124.     // Waveform Display
  125.     //
  126.     timeControl -e -waveform `optionVar -q timeSliderSoundDisplay` 
  127.         $gPlayBackSlider;
  128.  
  129.     // Repeat on Hold
  130.     //
  131.     timeControl -e -roh `optionVar -q timeSliderRepeatOnHold` 
  132.         $gPlayBackSlider;
  133.  
  134.     // Repeat Size
  135.     //
  136.     timeControl -e -rcs `optionVar -q timeSliderRepeatChunk` 
  137.         $gPlayBackSlider;
  138.  
  139.     //////////////////////////////////////////////////////////
  140.     // 
  141.     // MISCELLANEOUS
  142.     // 
  143.     //////////////////////////////////////////////////////////
  144.  
  145.     // Bind the time slider's selection connection to the animation list
  146.     //
  147.     timeControl -e -mainListConnection animationList $gPlayBackSlider;
  148.  
  149.     // Create the time dragger 3D slider     
  150.     //
  151.     timeDragger;
  152.  
  153.     //    Set the Time slider's initial visibility.
  154.     //
  155.     setTimeSliderVisible( `optionVar -query timeSliderVisible` );
  156. }
  157.